package com.peixunp.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.peixunp.bean.News;
import com.peixunp.bean.NewsKey;
import com.peixunp.dao.NewsDao;
import com.peixunp.service.NewsService;

import finaler.util.Page;
import finaler.util.PageList;

public class NewsServiceImpl implements NewsService {

	@Autowired
	private NewsDao newsDao;
	
	@Override
	public boolean insert(News news) throws Exception {
		return newsDao.insert(news);
	}

	@Override
	public PageList getNewsList(Page page) throws Exception {
		return newsDao.getNewsList(page);
	}

	@Override
	public News findByKey(int newsId) throws Exception {
		return newsDao.findByKey(new NewsKey(newsId));
	}

	@Override
	public boolean update(News news) throws Exception {
		return newsDao.update(news);
	}

}
